﻿
@{
    Layout = "";
}
<div class="w_loanDetail" ng-controller="DropGroupIndexController">

    <div class="w_jphdDiv">
        <!-- 轮播图 -->
        <div>
            <carousel interval="myInterval">
                <slide ng-repeat="slide in slides" active="slide.active">
                    <a href="javascript:void(0)"><img ng-src="{{slide.image}}" style="margin: auto;" alt="" /></a>
                </slide>
            </carousel>
        </div>
        <!-- 轮播图结束 -->
        <div class="w_jfdhxq_top" style="margin-bottom:0;">
            <div class="w_jfdhxq_topName">{{model.Title}}</div>
            <p class="w_jfdhxq_topPost">{{model.ProductDescription}}</p>
        </div>
        <ul class="w_jpacty_info">
            <li class="w_jpacty_infolia"><i>{{model.TeamCount}}人参加</i></li>
            <li class="w_jpacty_infolib">
                <div class="w_jpactyInfo_li2">起始价<small>￥</small><font color="#eb272a">{{model.StartingPrice}}</font></div>
                <div class="w_jpactyInfo_li2">抄底价<small>￥</small><font color="#eb272a">{{model.FloorPrice}}</font></div>
            </li>
        </ul>
        <div class="w_jpactyInfo_origin">原价<del>￥{{model.OriginalPrice}}</del></div>
        <div class="w_jpacty_mid">
            <ul class="w_jpacty_mida">
                <li>
                    <span>有进行中的团</span>
                </li>
                <li>
                    <span>自己当团长</span>
                </li>
            </ul>
            <ul class="w_jpacty_midb">
                <li class="w_jpacty_yellowBg"><a href="javascript:void(0)"  ng-click="gogrouphead(model.DropGroupID)">参加推荐团</a></li>
                <li class="w_jpacty_redBg" ng-show="isend==0"><a href="javascript:void(0)" ng-click="goopen(model.DropGroupID)">我要开团</a></li>
            </ul>
        </div>
        <div class="w_jpacty_midRule">
            <div class="w_jpactymd_ti">降拼玩法</div>
            <div class="w_jpactymd_con"><img src="/Content/images/w_78.png" /></div>
        </div>
        <!--商品详情-->
        <div class="w_jpacty_prodtl">
            <div class="w_jpactyProdtl_ti"><span>商品详情</span></div>
            <div class="w_jpactyProdtl_con" ng-bind-html="model.ProductDetail|to_trusted" id="detail"></div>
        </div>
    </div>
    <img src="/Content/images/pf_gz.png" alt="扫码关注" class="animated pf_gzImg swing  infinite" />
    <!--end 提示关注的漂浮菜单 -->
    <!-- 弹出二维码 -->
    <div class="f_popBox"></div>
    <div class="f_popMain">
        <div class="imgBox"><img src="/Content/images/sc_ewm1.png" alt="" /></div>
        <div class="szimg"><img src="/Content/images/sm_zw.png" alt="" /><span>扫一扫，关注公众号</span></div>
    </div>
    <!--end 弹出二维码 -->
</div>

<script>


    App.controller('DropGroupIndexController', [
           '$scope', '$http', '$rootScope', '$stateParams', '$state', '$filter',
       function ($scope, $http, $rootScope, $stateParams, $state, $filter) {
           $scope.model = {};
           $scope.CarouselList = {};
           $scope.isend = 0;
           $scope.nowtime = new Date();
           $http.post("/DropGroup/GetVDropGroupInfo", { id: $stateParams.Id }).then(function (response) {
               if (response.data.Result && response.data.Result != "") {
                   $scope.model = response.data.Result;
                   $scope.CarouselList = eval('(' + response.data.Result.ProductImgUrls + ')');
                   var endtime = new Date($scope.model.EndTime.replace(/-/g, '/'));
                   if ($scope.nowtime > endtime || $scope.model.State != 0) {
                       $scope.isend = 1;
                       layer.msg("该活动已结束！");
                   }

                   // 设置轮播图图片间隔
                   $scope.myInterval = 5000;
                   // 轮播图数据初始化
                   var slides = $scope.slides = [];
                   // 添加轮播图源
                   if ($scope.CarouselList.length > 0) {
                       angular.forEach($scope.CarouselList, function (img) {
                           slides.push({ image: $rootScope.ImgHostUrl + img });
                       });
                   }
               } else {
                   layer.msg("该活动商品已下架！");
                   $scope.isend = 1;
               }
           });
           var tt = function () {
               $rootScope.WxShare($rootScope.pageTitle(), '优品三悦', location.href, $rootScope.LogoUrl);

               $("#detail").find("img").css("width", "");
           }

           setTimeout(tt, 1000)

           $scope.goopen = function (id) {
               $state.go('shop.orderconfirm', { "activityId": id, "activityType": 2, "groupId": 0 });
           }

           $scope.gogrouphead = function (id) {
               $state.go('activity.groupheadlist', { "Id": id });
           }
       }]);

    $('.f_popMain').center();
    $('.pf_gzImg').click(function () {
        $('.f_popBox').show();
        $('.f_popMain').show();
    });    $('.f_popBox').click(function () {
        $('.f_popBox').hide();
        $('.f_popMain').hide();

    });
</script>
